Skip to content

improve performance of property reordering during feature decoding#561

Open
cportele wants to merge 1 commit into
masterfrom
cache-positions
Open

improve performance of property reordering during feature decoding#561
cportele wants to merge 1 commit into
masterfrom
cache-positions

Conversation

@cportele

Copy link
Copy Markdown
Contributor

The schema-order reordering pass sorted each object's children with a comparator that re-resolved a node's schema position on every comparison, and the coalesce step resolved it again two or three times per child, so the per-path lookup ran O(n log n) times for a node with n children.

Cache the resolved position on the node - computed once per reordering pass, where the mapping is constant - so each node is resolved at most once. Output is unchanged.

The schema-order reordering pass sorted each object's children with a
comparator that re-resolved a node's schema position on every comparison,
and the coalesce step resolved it again two or three times per child, so
the per-path lookup ran O(n log n) times for a node with n children.

Cache the resolved position on the node - computed once per reordering
pass, where the mapping is constant - so each node is resolved at most
once. Output is unchanged.
@cportele cportele requested a review from azahnen as a code owner June 29, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant